package pet_pavilion.yushougeums.repository.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import pet_pavilion.yushougeums.mapper.UserMapper;
import pet_pavilion.yushougeums.pojo.entity.User;
import pet_pavilion.yushougeums.repository.IUserRepository;

import java.util.List;

/**
 * 处理管理员数据的数据访问实现类
 *
 * @author java@tedu.cn
 * @version 0.0.1
 */
@Slf4j
@Repository
public class UserRepositoryImpl implements IUserRepository {

    @Autowired
    private UserMapper userMapper;

    public UserRepositoryImpl() {
        log.debug("创建数据访问实现类对象：AdminRepositoryImpl");
    }


    @Override
    public int insert(User user) {
        log.debug("开始执行【插入管理员】的数据访问，参数：{}", user);
        return userMapper.insert(user);
    }

    @Override
    public int insertBatch(List<User> userList) {
        log.debug("开始执行【批量插入管理员】的数据访问，参数：{}", userList);
        return userMapper.insertBatch(userList);
    }

}